package com.rpc.netty.sample.server.service;

import com.rpc.netty.core.server.RpcService;
import com.rpc.netty.sample.protocol.User;
import com.rpc.netty.sample.protocol.UserService;

import java.util.ArrayList;
import java.util.List;

/**
 *
 */
@RpcService(UserService.class)
public class UserServiceImpl implements UserService {

    @Override
    public List<User> get(String name, int num) {
        List<User> persons = new ArrayList<>(num);
        for (int i = 0; i < num; ++i) {
            persons.add(new User(Integer.toString(i), name));
        }
        return persons;
    }
}
